﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Glorysoft.EAP.Core.Entities
{
    public class TranslateMsg
    {
        public static string ClientLanguage = "EN";

        public TranslateMsg()
        {

        }
        public static Dictionary<string, string> GetTranslation(string msgName)
        {
            Dictionary<string, string> msgs = new Dictionary<string, string>();
            try
            {
                msgs.Add("CN", Messages[msgName].Split(':')[0]);
                msgs.Add("EN", Messages[msgName].Split(':')[1]);

            }
            catch (Exception)
            {
                return msgs;
            }
            return msgs;
        }

        public static Dictionary<string, string> GetTranslation(string msgName, params object?[] args)
        {
            Dictionary<string, string> msgs = new Dictionary<string, string>();
            try
            {
                msgs.Add("CN", string.Format(Messages[msgName].Split(':')[0], args));
                msgs.Add("EN", string.Format(Messages[msgName].Split(':')[1], args));

            }
            catch (Exception)
            {
                return msgs;
            }
            return msgs;
        }
        public static string GetENTranslation(string msgName)
        {
            try
            {
                return Messages[msgName].Split(':')[1];

            }
            catch (Exception)
            {
                return Messages[msgName].Split(':')[0];
            }
        }
        public static string GetCNTranslation(string msgName)
        {

            try
            {
                return Messages[msgName].Split(':')[0];

            }
            catch (Exception)
            {
                return Messages[msgName].Split(':')[0];
            }
        }
        public static Dictionary<string, string> Messages = new Dictionary<string, string>
        {
            {"StratTest","开始测试:starttesttttttttttttttt."},
             #region Login
            {"LoginMESOK","MES>{0},登陆成功:MES>{0},Login success"},
            {"LoginMESFAIL","MES>{0},登陆失败{1}:MES>{0},Login fail,{1}"},
            #endregion
            {"GetLotInfoFail","MES>{0},获取批次信息失败{1}.:MES>{0},GetLotInfoFailed{1}"},
             #region OCR S2F41TrackIn
            {"S2F41TrackInOK","OCR>设置Recipe、LotID成功:OCR> Set the Recipe、LotID success" },
            {"S2F41TrackInNG","OCR>{0}失败:OCR> {0} to fail" },
             #endregion         
             #region OCR S2F41StartTest
            {"S2F41StartTestOK","OCR>开始测试成功:OCR> Start Test success" },
            {"S2F41StartTestNG","OCR>开始测试失败{0}:OCR> Start Test Fails{0}" },
             #endregion
             #region OCR CheckNeedlePitch 针距检查
            {"CheckNeedlePitchOK","OCR>针距检查成功:OCR> The needle spacing check is success" },
            {"CheckNeedlePitchNG","OCR>针距检查失败，{0}:OCR>The needle spacing check is failed, {0}" },
             #endregion
             #region OCR CheckNeedleMark 针痕检查
            {"CheckNeedleMarkOK","OCR>针痕检查成功:OCR> The needle mark was checked success" },
            {"CheckNeedleMarkNG","OCR>针痕检查失败，{0}:OCR>The needle  mark was checked failed, {0}" },
             #endregion
             #region Daemon DownLoadTest 
            {"DownLoadTestOK","Daemon>下载Recipe成功:Daemon> Download Recipe success" },
            {"DownLoadTestNG","Daemon>下载Recipe失败,{0}:Daemon> Download Recipe failed,{0}" },
             #endregion
             #region  EndTest 
            {"EndTestOK","Daemon>结束测试成功:Daemon> End Test success" },
            {"EndTestNG","Daemon>结束测试失败:Daemon> End Test failed" },
            {"EndTestOKToEAP","OCR>结束测试成功:OCR> End Test success" },
            {"EndTestNGToEAP","OCR>结束测试失败:OCR> End Test failed" },
             #endregion
             #region  EndTest 
            {"StartTestOK","Daemon>开始测试成功:Daemon> Start Test success" },
            {"StartTestNG","Daemon>开始测试失败:Daemon> Start Test failed" },
            {"StartTestOKToEAP","OCR>开始测试成功:OCR> Start Test success" },
            {"StartTestNGToEAP","OCR>开始测试失败:OCR> Start Test failed" },
             #endregion
             #region MES TrackIn 
            {"MESTrackInOK","MES>进站成功:MES> Track In success" },
            {"MESTrackInNG","MES>进站失败,{0}:MES> Track In failed,{0}" },
            {"MESManualTrackIn","MES>批次 {0}, 已手动进站:MES>LotID, {0}, Already Manual Track In" },
             #endregion
             #region MES TrackOut 
            {"MESTrackOutOK","MES>{0},出站成功:MES> {0},Track Out success" },
            {"MESTrackOutNG","MES>{0},出站失败,{1}:MES> {0},Track Out failed,{1}" },
            #endregion
             #region Manual Automatic   Operation
            {"ManualOperation","EAP>EAP已切换手动操作:EAP> The EAP has been switched Manual Operation" },
            {"AutomaticOperation","EAP>EAP已切换自动操作:EAP> The EAP has been switched Automatic Operation" },
            #endregion
             #region SendCommand
            {"SendS2F41TrackIn","EAP>发送S2F41TrackIn命令给OCR:EAP> Send the S2F41 TrackIn command To OCR" },
            {"SendS2F41_UF2000_ProberDownloadRecipe","EAP>发送S2F41 ProberDownloadRecipe命令给OCR:EAP> Send the S2F41 ProberDownloadRecipe command To OCR" },
            {"SendS2F41_UF200R_ProberDownloadRecipe","EAP>发送S2F41 ProberDownloadRecipe命令给OCR:EAP> Send the S2F41 ProberDownloadRecipe command To OCR" },
            {"SendS2F41_SIDEA_ProberDownloadRecipe","EAP>发送S2F41 ProberDownloadRecipe命令给OCR:EAP> Send the S2F41 ProberDownloadRecipe command To OCR" },
            {"SendS2F41_DTS1000_TesterDownloadRecipe","EAP>发送S2F41 TesterDownloadRecipe命令给OCR:EAP> Send the S2F41 TesterDownloadRecipe command To OCR" },
            {"SendS2F41_ETS88_TesterDownloadRecipe","EAP>发送S2F41 TesterDownloadRecipe命令给OCR:EAP> Send the S2F41 TesterDownloadRecipe command To OCR" },
            {"SendS2F41_DOT800_TesterDownloadRecipe","EAP>发送S2F41 TesterDownloadRecipe命令给OCR:EAP> Send the S2F41 TesterDownloadRecipe command To OCR" },
            {"SendS2F41_RAYTREX_E4980A_TesterDownloadRecipe","EAP>发送S2F41 TesterDownloadRecipe命令给OCR:EAP> Send the S2F41 TesterDownloadRecipe command To OCR" },
            {"SendS2F41_RAYTREX_41000_TesterDownloadRecipe","EAP>发送S2F41 TesterDownloadRecipe命令给OCR:EAP> Send the S2F41 TesterDownloadRecipe command To OCR" },
            {"SendS2F41_Amida_TesterDownloadRecipe","EAP>发送S2F41 TesterDownloadRecipe命令给OCR:EAP> Send the S2F41 TesterDownloadRecipe command To OCR" },
            {"Send_TesterDownloadRecipe","EAP>发送S2F41 TesterDownloadRecipe命令给OCR:EAP> Send the S2F41 TesterDownloadRecipe command To OCR" },
            {"SendS2F41StartTest","EAP>发送S2F41StartTest命令OCR:EAP> Send the S2F41 StartTest command To OCR" },
            {"SendS2F41StartTestToProber","EAP>发送S2F41 StartTest 命令给Prober:EAP> Send the S2F41 StartTest command To Prober" },
            {"SendS2F41StartTestToTester","EAP>发送S2F41 StartTest 命令给Tester:EAP> Send the S2F41 StartTest command To Tester" },
            {"SendDownRecipe","EAP>发送下载Recipe信息给Daemon!:EAP> Send download Recipe Message to  Daemon" },
            {"SendEndTest","EAP>发送结束测试信息给Daemon:EAP> Send the EndTest Message to Daemon" },
            {"SendStartTest","EAP>发送开始测试信息给Daemon:EAP> Send the StartTest Message to Daemon" },
            {"SendS2F41EndTester","EAP>发送结束测试信息给OCR:EAP> Send the EndTest Message to OCR" },
            {"SendS2F41EndProbe","EAP>发送结束测试信息给OCR:EAP> Send the EndProbe Message to OCR" },
            {"SendS2F41DownLoadRecipe","EAP>发送S2F41 DownLoadRecipe 命令OCR:EAP> Send the S2F41 DownLoadRecipe command To OCR" },
            {"SendS2F41DownLoadRecipeToTester","OCR>测试机下载Recipe，输入Lot信息成功:OCR> Tester Download the Recipe and Enter the LotID success" },
          
            #endregion
             #region
             {"ReceiveS6F11Event","EAP>收到S6F11,{0}事件:EAP> Receive S6F11,{0} Event" },
             {"ReceiveS5F1Alarm","EAP>收到S5F1报警:EAP> Receive S5F1 Alarm" },
             {"ClearS5F1Alarm","EAP>清除S5F1报警:EAP> Clear S5F1 Alarm" },
             {"S6F11TestSuccess","OCR>测试机开始测试成功:OCR> The Tester Start test success" },
             {"S6F11EndTestSuccess","OCR>测试机结束测试成功:OCR> The Tester End test success" },
             {"S6F11TesterDownloadRecipe","OCR>开始执行Tester:OCR> Send the S2F41 TesterDownloadRecipe command To OCR" },
            #endregion
             #region 发送报警信息给RCM
            {"SendS5F1SetAlarm","EAP>发送S5F1报警消息给RCM:EAP> Send S5F1 Set Alarm Message to RCM" },
            {"SendS5F1ClearAlarm","EAP>发送S5F1消除报警消息给RCM:EAP> Send S5F1 Clear Alarm Message to RCM" },                    
            #endregion
             #region 发送状态给 RCM 
             {"SendS6F11EQPStatus","EAP>发送S6F11设备状态-{0}给RCM:EAP> Send S6F11 EQP Status -{0} to RCM" },
             {"SendS6F11RemainingTime","EAP>当前设备剩余时间 {0} 分钟!:EAP> The current equipment RemainingTime {0}  minutes" },
             #endregion
             {"ProbeCardValidationOK","EAP> 探卡ID验证成功:EAP>ProbeCardID Validation is success" },
             {"S2F41DownLoadRecipeLotInfoIsNull","EAP> 发送给OCR的数据异常，请联系EAP相关人员!:EAP>The Data Send To OCR is Abnormal. Please Contact the EAP Personnel" },
             {"SendHoldLot","EAP>EAP Lot Hold: {0} !:EAP> EAP Lot Hold: {0}!" },
             {"MESHoldLotNG","EAP>EAP Lot Hold: {0} !:EAP> EAP Lot Hold: {0}!" },
            {"MESHoldLotOK","EAP>EAP Lot Hold: Success !:EAP> EAP Lot Hold: Success!" },
              {"CheckWaferOK","EAP>Wafer比对成功!:EAP>Check Wafer is success!" },
            {"CheckWaferNG","EAP>Wafer比对失败!WaferId是{0},CPMAP文件中PassDie数量为{1},设备实际上报{2},lot hold!:EAP>Check Wafer is fail!waferId {0} is CP MAP count {1},EQP count {2},lot hold!" },
            {"CheckWaferTry","EAP>批次号或批次进站时间或者waferId为空!:EAP> lot or lot trackin time or slidesList is null !" },
            {"CheckWaferCount","EAP>上报Wafer数量和PassDie数量不一致或格式有误!:EAP> wafer count and passdie count is different or format is error!" },
            {"WaferFileisnull","EAP>文件读取有误，批次：{0}，位置：{1}文件数据为空!:EAP> file read error,lotid:{0},slot:{1} file is null!" },
            {"STARCheckZH","EAP>开始检查人员是否有截取针痕图片!:EAP> Start checking to see if the person has a picture of the intercept needle marks!" },
            {"CheckZHSuccess","EAP>检测到存在针痕图片，上传成功!:EAP> Needle mark image detected. Uploaded successfully!" },
            {"CheckZHFail","EAP>未检测到针痕图片!:EAP> No needle marks were detected!" },
            {"CheckZHErr","EAP>检测到针痕图片异常,请联系管理员!:EAP> Abnormal needle marks have been detected. Please contact the administrator!" },
            {"CheckZHExist","EAP>当前Lot针痕图片已存在，请检查!:EAP> Currently a Lot of needle mark pictures already exist, please check!" },
            {"CheckZHConfigErr","EAP>配置项CheckZHPath或CheckZHUPLOADPath路径不存在，请检查!:EAP> The configuration entry CheckZHPath or CheckZHUPLOADPath path does not exist!" },
            {"FTPErr","EAP>检查CheckZHPath存放目录配置不正确，正确格式为ftp路径,账号,密码，请检查!:EAP> The configuration of the storage directory is incorrect. The correct format is ftp path,account,password!" },
            {"ZHFTPErr","EAP>检查CheckZHUPLOADPath存放目录配置不正确，正确格式为ftp路径,账号,密码，请检查!:EAP> The configuration of the storage directory is incorrect. The correct format is ftp path,account,password!" },
            {"TrackOutErr","EAP>配置项TrackOutPl或TrackOutTotal不存在，请检查!:EAP> The configuration entry TrackOutPl or TrackOutTotal does not exist!" },
            {"TrackOutFail","EAP>批次{2}出站失败，将在{0}分钟后再次出站，剩余出站时间{1}分钟!:EAP> Lotid {2} Exit failed, Outbound will be called again after {1} minute with {2} minutes remaining" },
            {"TrackOutStop","EAP>批次{0}已循环出站{1}分钟，结束出站 :EAP>Batch {0} has cycled out of the station for {1} minutes, ending the exit" },
            {"LotEnd","EAP>{0}批次已作业结束，开始出站:EAP>{0}LotEnd Received!" },
            {"STDFReport","EAP>STDF文件生成，{0}开始解析:EAP>STDF File Generated! Start Parse{0}" },
            {"WaferEndReport","EAP>设备上报WaferId：{0} 测试结束,PassDie数量：{1}:Equipment Report WaferEnd,WaferId：{0},PassDie Count：{1}"},
        };

    }
}
